package com.zhangpengtao.www;

import com.sun.tools.jconsole.JConsoleContext;

//1000以内水仙花数个数
public class ForDemo6 {
    public static void main(String[] args) {
        int count = 0;
        for(int i = 100 ; i <= 1000; i++){
            int Digits = i % 10;
            int Tens = i / 10 % 10;
            int Hundreds = i / 10 / 10 % 10;
            if(Digits * Digits * Digits + Tens* Tens * Tens + Hundreds * Hundreds * Hundreds == i ){
                count++;
            }
        }
        System.out.println(count);
    }
}
